home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-04-08 | 2.9 KB | 74 lines | [TEXT/GEOL] |
- Item forwarded by BURBECK.S to ALCABES
-
- Item 8993195 7-April-89 09:12
-
- From: N0658 ESL, Robert Penland, ASC
-
- To: MACDTS Macintosh Developer Technical Supt.
-
- cc: MACAPP.TECH$ MACAPP Tech
-
- Sub: 68881 & MacApp2.0b5 woes
-
- Hi Techies,
-
- I submitted a question about a week ago that concerned using the 68881 option
- when compiling and using MacApp2.0b5 with MPW 3.0 final. I received the
- following response from Keith Rollin at MacDTS:
-
-
- {****************************************************}
- I've looked into the problems with printing Reals, and I think that I've found
- out what is causing it. It seems to be a Pascal bug.
-
- I traced through the code that Robert Penland provided, and found that the
- values were being calculated and stored correctly. However something happened
- between that time and the time they were printed out. Here's what I found:
-
- When the method is entered, the handle to the object is stored in A4. When the
- time comes to store a value into fStart, the following instructions are
- executed:
-
- move.l (A4),A0
- FPMove.S FP0,$000E(A0)
-
- This is just fine. However, this is the ONLY time that a pointer to the object
- is dereferenced and put into A0!!!
-
- The other 2 values (fStop and fLogStart) are generated and stored correctly.
- Then the time comes to print out the string. A pointer to 'fStart =' is pushed
- onto the stack, and a routine called _W_STR is called. When it comes back, A0
- is trashed!!! The object hasn't moved, so no memory compaction occured; it's
- just that A0 has changed and no longer points to the object.
-
- Changing your lines to read like this will solve the problem:
-
- fStart := ((12500000.0/4096.0)*224.0)/(128.0*1024);
- fStop := ((12500000.0/4096.0)*448.0)/1024.0;
- fLogStart := Log2(((12500000.0/4096.0)*224.0)/(128.0*1024.0));
-
- tStart := fStart; tStop := fStop; tLogStart := fLogStart;
-
- writeln('start = ',tStart,'stop = ',tStop,'logStart = ',tLogStart);
-
-
- where tStart, tStop, and tLogStart are locals.
- {******************************************************}
-
- This looks like a major bug to me. Does this mean that anytime I use a writeln
- in my code that I'm going to trash the reference to my object? The problem with
- the real number values doesn't seem to be confined to just writelns, I've
- observed some very strange behaviour just while using real object data fields
- in calculations. Also, why does this only seem to manifest itself when I have
- the 68881 option on? It compiles and runs fine in both debug and optimized
- mode without the 68881 option on.
-
- The speed of my applicaton is greatly enhanced if I can use the 68881, but
- right now I can't seem to do that with MacApp 2.0b5.
- I guess my real question is this a known compiler problem and if so is
- something being done to fix it?
-
- Regards
- Robert Penland
-
-